public class Student {
    private String id;
    private String name;
    private String gender;
    private String grade; // 新增年级属性
    private Course selectedCourse;

    public Student(String id, String name, String gender, String grade) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.grade = grade; // 初始化年级
    }

    // 选课方法
    public void selectCourse(Course course) {
        this.selectedCourse = course;
    }

    // 退课方法
    public void dropCourse() {
        this.selectedCourse = null;
    }

    // getter和setter方法
    public Course getSelectedCourse() {
        return selectedCourse;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public String getGrade() { // 年级的getter方法
        return grade;
    }
}
